<template>
<h1>事件绑定</h1>
  <input type="button" value="按钮1" @click="f()">
  <input type="button" value="按钮2" v-on:click="f()">
</template>

<script setup>
  const f = ()=>{
    alert("按钮被点击了!");
  }
</script>

<style scoped>

</style>